﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="UI.system.index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>亿销客管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <script src="/system/js/jquery.min.js"></script>
    <script src="/system/layui/layui.js"></script>
    <script src="/system/js/common.js?v=1"></script>
    <script src="/system/js/md5.js?v=1"></script>
    <script src="/system/js/swfupload.js"></script>
    <script src="/system/layui/lay/modules/laydate.js"></script>
    <script type="text/javascript" src="/system/js/mootools-core.js"></script>
    <script type="text/javascript" src="/system/js/mediabox.js"></script>
    <script type="text/javascript" charset="utf-8" src="/system/uedit/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/system/uedit/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="/system/uedit/lang/zh-cn/zh-cn.js"></script>
    <link rel="stylesheet" href="/system/layui/css/layui.css">
    <link rel="stylesheet" href="/system/layui/css/global.css">
    <link rel="stylesheet" href="/system/css/iframe.css">
</head>
<body>
    <form id="form1" runat="server">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header header header-demo">
            <div class="layui-main" style="margin-left: 0px;">
                <a class="logo" href="/">
                    <img src="img/logo.png"></a> <a class="name">亿销客管理系统</a>
                <ul class="layui-nav">
                    <li class="layui-nav-item" style="margin-right: 35px;"><a href="javascript:;">
                        <%=user.RealName %></a>
                        <dl class="layui-nav-child">
                           <%-- <%if (user.Role == 2){ %>
                                <dd>
                                <a href="javascript:UpdateAgentInfo(<%=agentinfo.ID %>)">修改信息</a></dd>
                            <%} %>--%>
                            <dd>
                                <a href="javascript:UpdatePwd()">修改密码</a></dd>
                            <dd>
                                <a href="/system/login.aspx?flag=loginout">退出</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
        </div>
        <div class="layui-side layui-bg-black">
            <ul class="layui-nav layui-nav-tree" lay-filter="demo">
                <!-- 侧边导航: <ul class="layui-nav layui-nav-tree layui-nav-side"> -->
                <li class="layui-nav-item layui-nav-itemed"><a href="javascript:;" class="bigmenu">系统管理</a>
                    <dl class="layui-nav-child">
                        <%if (user.Role == 1)
                          { %>
                        <dd data-id="tab-user" data-src="page/user/userlist.aspx">
                            <a href="javascript:void(0);">&nbsp;&nbsp;<i class="layui-icon" style="top: 1px;">&#xe62d;</i>
                                <font>会员管理</font></a></dd>
                        <dd data-id="tab-active" data-src="page/active/activelist.aspx">
                            <a href="javascript:void(0);">&nbsp;&nbsp;<i class="layui-icon" style="top: 1px;">&#xe62d;</i>
                                <font>活动管理</font></a></dd>
                        <dd data-id="tab-kf" data-src="page/kf/kflist.aspx">
                            <a href="javascript:void(0);">&nbsp;&nbsp;<i class="layui-icon" style="top: 1px;">&#xe62d;</i>
                                <font>客服管理</font></a></dd>
                        <dd data-id="tab-kl" data-src="page/active/reducelist.aspx">
                            <a href="javascript:void(0);">&nbsp;&nbsp;<i class="layui-icon" style="top: 1px;">&#xe62d;</i>
                                <font>扣量管理</font></a></dd>
                        <dd data-id="tab-charge" data-src="page/charge/chargelist.aspx">
                            <a href="javascript:void(0);">&nbsp;&nbsp;<i class="layui-icon" style="top: 1px;">&#xe62d;</i>
                                <font>充值记录</font></a></dd>
                        <dd data-id="tab-apply" data-src="page/apply/applylist.aspx">
                            <a href="javascript:void(0);">&nbsp;&nbsp;<i class="layui-icon" style="top: 1px;">&#xe62d;</i>
                                <font>合作申请</font></a></dd>
                        <dd data-id="tab-config" data-src="page/config/config.aspx">
                            <a href="javascript:void(0);">&nbsp;&nbsp;<i class="layui-icon" style="top: 1px;">&#xe62d;</i>
                                <font>基本设置</font></a></dd>
                        <dd data-id="tab-agent" data-src="page/agent/agentlist.aspx">
                            <a href="javascript:void(0);">&nbsp;&nbsp;<i class="layui-icon" style="top: 1px;">&#xe62d;</i>
                                <font>代理商信息</font></a></dd>
                        <dd data-id="tab-admin" data-src="page/admin/adminlist.aspx">
                            <a href="javascript:void(0);">&nbsp;&nbsp;<i class="layui-icon" style="top: 1px;">&#xe62d;</i>
                                <font>管理员管理</font></a></dd>
                        <%}
                          else if (user.Role == 2)
                          {%>
                        <dd data-id="tab-user" data-src="page/user/userlist.aspx">
                            <a href="javascript:void(0);">&nbsp;&nbsp;<i class="layui-icon" style="top: 1px;">&#xe62d;</i>
                                <font>会员管理</font></a></dd>
                        <dd data-id="tab-active" data-src="page/active/activelist.aspx">
                            <a href="javascript:void(0);">&nbsp;&nbsp;<i class="layui-icon" style="top: 1px;">&#xe62d;</i>
                                <font>活动管理</font></a></dd>
                        <dd data-id="tab-charge" data-src="page/charge/chargelist.aspx">
                            <a href="javascript:void(0);">&nbsp;&nbsp;<i class="layui-icon" style="top: 1px;">&#xe62d;</i>
                                <font>充值记录</font></a></dd>
                        <dd data-id="tab-apply" data-src="page/apply/applylist.aspx">
                            <a href="javascript:void(0);">&nbsp;&nbsp;<i class="layui-icon" style="top: 1px;">&#xe62d;</i>
                                <font>合作申请</font></a></dd>
                        <dd data-id="tab-admin" data-src="page/admin/adminlist.aspx">
                            <a href="javascript:void(0);">&nbsp;&nbsp;<i class="layui-icon" style="top: 1px;">&#xe62d;</i>
                                <font>代理商管理</font></a></dd>
                        <%  }%>
                    </dl>
                </li>
            </ul>
        </div>
        <div class="layui-body site-demo" style="margin: 0px; padding: 0px;">
            <div class="layui-tab layui-tab-card" lay-allowclose="true" lay-filter="demo" style="border: 0px;
                margin: 0px; padding: 0px; height: 100%; overflow: hidden;">
                <ul class="layui-tab-title">
                    <li class="layui-this" lay-id="11">活动管理</li>
                </ul>
                <div class="layui-tab-content" style="height: 100%; overflow-y: hidden; margin: 0px;
                    padding: 0px;">
                    <div class="layui-tab-item layui-show">
                        <iframe id="iframe5" src="page/active/activelist.aspx"></iframe>
                    </div>
                </div>
            </div>
        </div>
        <!--
        <div class="layui-footer footer footer-demo">
            世纪信联业务管理系统
        </div>
        -->
    </div>
    </form>
    <script>
        function UpdatePwd() {
            Ajax.Get("/system/page/user/pwdupdate.html?v=1", function (html) {
                LayerBox.Show("修改密码", html, 500, 300, function (form) {
                    form.verify({
                        oldpwd: function (value) {
                            if (value == "") {
                                return '请输入旧密码';
                            }
                        },
                        newpwd: function (value) {
                            if (value == "") {
                                return '请输入新密码';
                            }
                        },
                        surepwd: function (value) {
                            if (value != $("#newpwd").val()) {
                                return '2次输入密码不一致';
                            }
                        }
                    });
                },
                function (form) {
                    var data = {};
                    data.act = "Update_Pwd";
                    data.oldpwd = form.oldpwd;
                    data.newpwd = form.newpwd;
                    data.sign = GetSign(data.act);
                    var index = LayerBox.Loading();
                    Ajax.Post("/tools/Admin.ashx", data, function (r) {
                        LayerBox.Close.ByIndex(index);
                        var json = $.parseJSON(r);
                        if (json.state) {
                            LayerBox.Success(json.msg, 500, function () {
                                LayerBox.Close.ByAll();
                            });
                        }
                        else {
                            LayerBox.Error(json.msg);
                        }
                    });
                });
            });

        };
        function UpdateAgentInfo(id) {
            LayerBox.Loading();
            Ajax.Get("/system/page/agent/agentadd.aspx?id=" + id, function (html) {
                LayerBox.Close.ByAll();
                window.parent.LayerBox.Show("修改个人信息", html, 390, 350, null, function (form) {
                    var data = form;
                    data.act = "Save_Agent";
                    data.id = id;
                    data.sign = GetSign(data.act);
                    data.adminid = <%=user.ID %>;
                    data.agentname = "<%=user.RealName %>";
                    data.img = window.parent.$(".img_container img").attr("src");
                    if (data.img == "") {
                        LayerBox.Error("请上传二维码");
                        return;
                    }
                    LayerBox.Loading();
                    Ajax.Post("/tools/Admin.ashx", data, function (r) {
                        var json = $.parseJSON(r);
                        if (json.state) {
                            LayerBox.Success(json.msg, 500, function () {
                                LayerBox.Close.ByAll();                                
                            });
                        }
                        else {
                            LayerBox.Error(json.msg);
                        }
                    });
                });
                var upload = new window.parent.Upload_File("upload_img");
                upload.swfu.handle = "upload_active";
            });
        }

        layui.config({
            base: 'layui/lay/modules/',
            version: new Date().getTime()
        }).use(['element', 'layer', 'form'], function () {
            var element = layui.element(),
	            layer = layui.layer;
            $(".layui-nav-tree dd").click(function () {
                var src = $(this).data("src");
                var id = $(this).data("id");
                var title = $(this).find("font").html();
                if ($(".layui-tab li[lay-id='" + id + "']").length == 0) {
                    //LayerBox.Load();
                    element.tabAdd('demo', {
                        title: title,
                        content: '<iframe src="' + src + '?id=' + id + '"></iframe><div class="loading" id="' + id + '"></div>',
                        id: id
                    });
                }
                element.tabChange('demo', id);
            });
        });
    </script>
</body>
</html>
